<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        /*
            var fn;
            function func() {
                console.log('fun');
            }
            // 执行
            func();//fun
            var fn = function () {
                console.log('fn');
            }
            fn();//fn
            fn = 100;
            fn();//报错
        */

        // func();//fun
        // var fn = function () {
        //     console.log('fn');
        // }

        // function func() {
        //     console.log('fun');
        // }
        // fn();//fn
        // fn = 100;
        // fn();//报错

        /*
            var fun;

            fun = 200;
            fun();//报错
        
        */

        var fun = 200;
        fun()
        var fun = function () {
            console.log('fun')
        }
        fun();
    </script>
</body>

</html>